
#ifndef GEOSPHEREFACE_H
#define GEOSPHEREFACE_H

#include <list>
#include "vec3f.h"
#include "GeosphereVert.h"

#include <iostream>

using namespace std;

class GeosphereFace {

	public:

		GeosphereFace();
		void setVerts(vec3f a, vec3f b, vec3f c);
		void calcFaceNorm();
		void doSplit(float r, int levelsLeft);
		void collectFaces(list<GeosphereFace*>& faceList);
		GeosphereVert** getVerts();
		bool getIsDivided();
		const vec3f* getFaceNorm();
		GeosphereFace* getFace(int index);
		const GeosphereVert* getVert(int index);

		/*void printAdjFaces(int i) {
			cout << "AdjFaces for geo " << this << " vert " << verts[i] << "...... ";
			list<GeosphereFace*>::iterator k;
			for ( k = verts[i]->adjFaces.begin() ; k != verts[i]->adjFaces.end() ; k++ ) {
				cout << (*k) << ", ";
			}
			cout << endl;
		}*/

	private: 

		bool isDivided;
		GeosphereVert** verts;
		GeosphereFace* faces;
		vec3f faceNorm;

};

#endif
